/*******************************************************************************
 * Copyright (c) 2006 CEA List.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     CEA List - initial API and implementation
 *******************************************************************************/
package com.cea.papyrus.core.commonbehavior.factory;

import com.cea.papyrus.core.helper.DefaultModelerHelper;
import com.cea.papyrus.core.helper.GraphEdgeHelper;
import com.cea.papyrus.core.helper.NodeHelper;

/**
 * 
 * 
 * @author Remi SCHNEKENBURGER
 */
public class BehaviorModelerFactory extends DefaultModelerHelper {

	/**
	 * 
	 */
	private static BehaviorModelerFactory EINSTANCE; 

	/**
	 * Ordered set of UML elements that can be created.
	 */
	protected final Class elementTypes[] = {
			org.eclipse.uml2.uml.OpaqueBehavior.class,
			org.eclipse.uml2.uml.Activity.class,
	};
	
	/**
	 * Ordered set of factories that are associated to UML elements.
	 */
	protected final NodeHelper nodeFactory[] = {
			new OpaqueBehaviorNodeFactory(),
			new ActivityNodeFactory(),
	};
	
	/**
	 * Ordered set of factories that are associated to UML connections.
	 */
	protected final Class edgeTypes[] = {
	};

	/**
	 * Ordered set of factories that are associated to UML connections.
	 */
	protected final GraphEdgeHelper edgeFactory[] = {
	};
	
	/**
	 * Create the factories for model elements.
	 */
	public BehaviorModelerFactory() {
		//		CreateFactories
		for(int i=0; i<elementTypes.length; i++){
			creationFactoryMap.put( elementTypes[i], nodeFactory[i]);}	
		for(int i=0; i<edgeTypes.length; i++){
			creationFactoryMap.put( edgeTypes[i], edgeFactory[i]);}	
	}
	
	/**
	 * Returns the unique instance (Singleton pattern).
	 * 
	 * @return this instance of Factory
	 */
	public static BehaviorModelerFactory getInstance(){
		if (EINSTANCE==null){
			EINSTANCE=new BehaviorModelerFactory();
		}
		return EINSTANCE;
	}
	
	/* (non-Javadoc)
	 * @see com.cea.papyrus.core.common.factories.IModelerFactory#getId()
	 */
	/**
	 * 
	 * 
	 * @return 
	 */
	@Override
	public String getId() {
		return "NULL_DIAGRAM_ID";
	}
}
